﻿using System;
using System.Collections.Generic;

using Kenly.DBFramework.Gateway;

namespace Kenly.DBFramework.Reflection
{
    internal interface ICommandReflector
    {
        
        string Delete(Type entityType, string condition);
        string DeleteById(object entity);
        string DeleteByPK(object entity);

        string Exists(Type entityType, string condition);
        string ExistsById(object entity);
        string ExistsByPK(object entity);

        string Insert(Type entityType, bool returnIdentity, List<string> propertyNames);

        string Update(Type entityType, string condition, List<string> propertyNames);
        string UpdateById(object entity,List<string> propertyNames);
        string UpdateByPK(object entity, List<string> propertyNames);

        string SelectByCondition(Type entityType, string condition);
        string SelectByCondition(Type entityType, string condition, Order order, List<string> propertyNames);
        string SelectDistinctByCondition(Type entityType, string columnName, string condition, OrderDirection direction);
        string SelectById(object entity);
        string SelectByPK(object entity);
        string SelectByInterrelationTable(object entity, Type interrelationType, string referrenceCondition, Order order, List<string> propertyNames);
        string SelectNextIdentity(Type entityType);
        string SelectPaging(Type entityType, string condition, Order order, int pageSize, int pageIndex, List<string> propertyNames);
        string SelectTop(Type entityType, string condition, int topCount, Order order, List<string> propertyNames);

        string Count(Type entityType, string condition);
        string CountGroup(Type entityType, string condition, string groupBy);

        string Sum(Type entityType, string columnName, string condition);
        string SumGroup(Type entityType, string columnName, string condition, string groupBy);

        string Max(Type entityType, string columnName, string condition);
        string MaxGroup(Type entityType, string columnName, string condition, string groupBy);

        string Min(Type entityType, string columnName, string condition);
        string MinGroup(Type entityType, string columnName, string condition, string groupBy);
    }
}
